//
//  SDAnswersDetectionModel.m
//  skinDetection
//
//  Created by  liangzhun on 2019/3/6.
//  Copyright © 2019年  liangzhun. All rights reserved.
//

#import "SDAnswersDetectionModel.h"
#import "SDAnswerTestBaseClass.h"
@implementation SDAnswersDetectionModel

static SDAnswersDetectionModel *model;
static dispatch_once_t onceToken;
+ (instancetype)shareInstance
{
    
    
    dispatch_once(&onceToken, ^{
        model = [[SDAnswersDetectionModel alloc] init];
        model.resultDic = [[NSMutableDictionary alloc] initWithCapacity:0];
    });
    return model;
    
}
- (void)loadDataWithBlock:(fisnshblock)block
{
    [SDNetwork getQuestionSurveyAllFinish:^(NSDictionary * _Nullable dic, NSError * _Nullable error) {
        if (!error) {
            
            self.dataArray = [SDAnswerTestBaseClass modelObjectWithDictionary:dic].data;
            block(YES);
        }
    }];
    
}
+ (void)clearModel
{
    model = nil;
    onceToken = 0;
}
@end
